package com.chinatelecom.telecollege.sellerrewarding.service;

/**
 * Created by lenovo on 2017/6/21.
 */
import com.chinatelecom.telecollege.sellerrewarding.repository.servicehallRepo;
import com.chinatelecom.telecollege.sellerrewarding.Entity.servicehall;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class servicehallService {

    @Autowired
    private servicehallRepo servicehallRepo;

    @Transactional
    public servicehall find(int id) {
        return servicehallRepo.findOne(id);
    }
    public void save(String name) {
        servicehall servicehall = new servicehall();
        servicehall.setName(name);
        servicehallRepo.save(servicehall);
    }
    public void save(int id, String name) {
        servicehall servicehall = new servicehall();
        servicehall.setId(id);
        servicehall.setName(name);
        servicehallRepo.save(servicehall);
    }
    public void delete(int id) {
        servicehallRepo.delete(id);
    }
    public List<servicehall> findAll() {
        return servicehallRepo.findAll();
    }
}
